#!/bin/bash
set -e

function info() {
echo Usage: `basename $0` [-u p c] '<url>'
exit 65
}

while getopts  ":u:p:ch" opts
do
        case  $opts  in
		u) user=$OPTARG;;
		p) pass=$OPTARG;;
		c) opt_c=-c;;
		h) info;;
		esac
done
shift $(($OPTIND - 1))

if [ -z "$1" ]; then info; fi


. /mnt/ilustre/app/medical/tools/.var

# export HISTFILE=. 

if test -z "$user"; then
echo wget -t5 $opt_c $@
wget -t5 $opt_c $@
else
echo wget --http-user=$user --http-passwd=$pass $@
wget --http-user=$user --http-passwd=$pass -t5 $opt_c $@
fi



